package com.eastfair.certificate.api;

import cn.hutool.core.collection.CollectionUtil;
import com.eastfair.annotation.annotation.log.SysLog;
import com.eastfair.certificate.dto.CertificateIndexDTO;
import com.eastfair.certificate.dto.CertificateOrderDTO;
import com.eastfair.certificate.dto.CertificateUserDTO;
import com.eastfair.certificate.entity.CertificateOrder;
import com.eastfair.certificate.enumeration.CertificateOrderOrderStatusEnum;
import com.eastfair.certificate.exceptioncode.CertificateExceptionCode;
import com.eastfair.certificate.hystrix.CertificateApiFallback;
import com.eastfair.certificate.vo.CertificateOrderVO;
import com.eastfair.common.req.CertificateIndexReq;
import com.eastfair.common.vo.CarInOffRecord;
import com.eastfair.common.vo.CertBlackList;
import com.eastfair.core.base.R;
import com.eastfair.core.exception.NoBackBizException;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * auth feign接口
 *
 * @Author ligang
 * @Date 2021/7/16 16:41
 */
@FeignClient(name = "certificate", fallback = CertificateApiFallback.class)
public interface CertificateApiFeign {



    /**
     * @Author ligang
     * @Description 同步车辆出入信息
     * @Date 11:17 2023/1/20
     * @Param [carInOffRecord]
     * @return
     **/
    @PostMapping("/sycn/sycnCarOff")
    R sycnCarOff(@RequestBody CarInOffRecord carInOffRecord);



    /**
     * @return
     * @Author ligang
     * @Description 同步证件信息
     * @Date 11:17 2023/1/20
     * @Param [carInOffRecord]
     **/
    @GetMapping("/sycn/sycnCertificate")
    R<List<CertificateUserDTO>> sycnCertificate();




    /**
     * @return
     * @Author ligang
     * @Description 同步证件指标信息
     * @Date 11:17 2023/1/20
     * @Param [carInOffRecord]
     **/
    @PostMapping("/sycn/sycnCertificateIndex")
    R<List<CertificateIndexReq>> sycnCertificateIndex(@RequestBody CertificateIndexDTO certificateIndexDTO);


    /**
     * @Author ligang
     * @Description 同步黑名单信息
     * @Date 11:17 2023/1/20
     * @Param [carInOffRecord]
     * @return
     **/
    @PostMapping("/sycn/blackList")
    R sycnBlackList(@RequestBody List<CertBlackList> certBlackLists);




    /**
     * 预支付订单
     *
     * @param certificateOrderDTO  传orderNumber 订单编号
     * @return
     */
    @PostMapping("/certificateOrder/readyPayOrder")
    R readyPayOrder(@RequestBody CertificateOrderDTO certificateOrderDTO) ;



    /**
     * 支付订单
     *
     * @param certificateOrderDTO  传orderNumber订单编号   orderMoney订单支付金额
     * @return
     */
    @PostMapping("/certificateOrder/payOrder")
    R<CertificateOrderVO> payOrder(@RequestBody CertificateOrderDTO certificateOrderDTO);

}
